package cn.com.dubbo.server.controller;

import com.demo.dubbo.api.response.ResponseResult;
import com.demo.dubbo.api.service.IDubboItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: IntelliJ IDEA
 * @Author: Mr.May
 * @Date: 2021/3/24
 */
@Slf4j
@RestController
@RequestMapping(value = "/dubboTwo")
public class ItemController {
    @Autowired
    private IDubboItemService dubboItemService;

    @RequestMapping(value = "/item/list")
    public ResponseResult itemList() {
        try {
            return dubboItemService.itemList();
        } catch (Exception e) {
            e.printStackTrace();
            log.error("item/list[发生错误]");
            return ResponseResult.fail();
        }
    }
}
